/**
 *
 * Copyright (c) 2011 TLOSS. All rights reserved.
 * Created on Apr 22, 2011
 *
 */
package com.tloss.database.db2obj.utils;

/**
 * @author Tran Tung
 * 
 */
public class NameUtils {
	public String getClassName(String name) {
		if (name != null && !"".equals(name.trim())) {
			name = name.replaceAll(" ", "");
			if (name != null && !"".equals(name.trim())) {
				return name.substring(0, 1).toUpperCase() + name.substring(1);
			}
		}
		return null;
	}

	public String getFieldNameToSetGet(String field) {
		return getClassName(field);
	}
	public String getFieldName(String field) {
		if (field != null && !"".equals(field.trim())) {
			field = field.replaceAll(" ", "");
			if (field != null && !"".equals(field.trim())) {
				return field.substring(0, 1).toLowerCase() + field.substring(1);
			}
		}
		return null;
	}
}
